using System;

namespace BoxBinary.AspectCache.Core.PolicyDefinition
{
    /// <summary>
    /// Flags to describe the nature of an object instance such that the <see cref="PolicyBoundCachePackage"/> can make a decision about a suitable cache
    /// configuration to use (such as priority level, and caching store).
    /// <para>ChangeFrequency: The relative amount that the instance would change, were it not to be cached.</para>
    /// <para>CreationExpense: The relative expense of instantiating an object, were it not to be cached. For example, an object may populate
    /// itself from Xml returned from a Soap call which involves a high amount of resources and time to complete the request.</para>
    /// <para>HeapRequirement: The relative amount of memory required by an instance of the object, whether stored in cache or not.</para>
    /// </summary>
    [Flags]
    public enum CacheItemFootprint
    {
        /// <summary>
        /// Object instance to be cached is based on data which changes very infrequently
        /// </summary>
        LowChangeFrequency = 1,
        /// <summary>
        /// Object instance to be cached is based on data which changes at an intermediate frequency
        /// </summary>
        MediumChangeFrequency = 2,
        /// <summary>
        /// Object instance to be cached is based on data which changes very frequently
        /// </summary>
        HighChangeFrequency = 4,
        /// <summary>
        /// Object instance to be cached has a very low instantiation time
        /// </summary>
        LowCreationExpense = 8,
        /// <summary>
        /// Object instance to be cached has a moderate instantiation time
        /// </summary>
        MediumCreationExpense = 16,
        /// <summary>
        /// Object instance to be cached has a very high instantiation time
        /// </summary>
        HighCreationExpense = 32,
        /// <summary>
        /// Object instance to be cached consumes a low amount of memory
        /// </summary>
        LowHeapRequirement = 64,
        /// <summary>
        /// Object instance to be cached consumes a moderate amount of memory
        /// </summary>
        MediumHeapRequirement = 128,
        /// <summary>
        /// Object instance to be cached consumes a very high amount of memory
        /// </summary>
        HighHeapRequirement = 256,
        /// <summary>
        /// Object instance to be cached insists on surviving application restarts, i.e. is persisted to disk
        /// </summary>
        ForceSurviveApplicationRestarts = 512,
        /// <summary>
        /// Object instance to be cached is based on entirely static data
        /// </summary>
        NilChangeFrequency = 1024
    }
}